//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { Config, ConfigResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooConfigList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<ConfigResponse>(`/uctoo/config/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooConfig = async (id: string) => {
  return requestClient.get<Config>(`/uctoo/config/${id}`);
};

export const adductooConfig = async (data: Partial<Config>) => {
  return requestClient.post<Config>('/uctoo/config/add', data);
};

export const edituctooConfig = async (data: Partial<Config>) => {
  return requestClient.post<Config>('/uctoo/config/edit', data);
};

export const deleteuctooConfig = async (id: string) => {
  return requestClient.post<any>('/uctoo/config/del', { id });
};
